package cn.iocoder.yudao.module.myerp.dal.mysql.SKCproduct;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.myerp.dal.dataobject.SKCproduct.ErpProductSkcDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.myerp.controller.admin.SKCproduct.vo.*;

/**
 * ERP SKC级产品 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ErpProductSkcMapper extends BaseMapperX<ErpProductSkcDO> {

    default PageResult<ErpProductSkcDO> selectPage(ErpProductSkcPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductSkcDO>()
                .eqIfPresent(ErpProductSkcDO::getId, reqVO.getId())
                .eqIfPresent(ErpProductSkcDO::getSpu, reqVO.getSpu())
                .eqIfPresent(ErpProductSkcDO::getSkc, reqVO.getSkc())
                .eqIfPresent(ErpProductSkcDO::getShopId, reqVO.getShopId())
                .likeIfPresent(ErpProductSkcDO::getName, reqVO.getName())
                .eqIfPresent(ErpProductSkcDO::getCategoryId, reqVO.getCategoryId())
                .orderByDesc(ErpProductSkcDO::getId));
    }

}